import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
// 定义路由路径
const routes = [
  {
    path: "/",
    // alias: "/home",
    alias: ["/home", "/index"],
    // component: () => import("../views/index.vue")

    // 配置路径别名@
    component: () => import("@/views/index.vue")
  },
  {
    path: "/content",
    // component: () => import("../views/content.vue")
    component: () => import("@/views/content.vue")
  },
  {
    path: "/fileList",
    // component: () => import("../views/content.vue")
    component: () => import("@/views/fileList.vue")
  },
  {
    path: "/errorWords",
    // component: () => import("../views/content.vue")
    component: () => import("@/views/errorWords.vue")
  },
  {
    // path: "/user/:id",
    // path: "/user/:id/name/:name",
    path: "/user/:id/name/:name?",
    name: "member",
    component: () => import("@/views/user.vue")
  }
]

const router = createRouter({
  // 1. 使用传统url模式
//   history: createWebHistory(),
  
  // 2. 使用带#号的哈希模式
  history: createWebHashHistory(),

  routes
})
window.$router = router
export default router